package com.example.petproject.controller;

import com.example.petproject.entity.vo.ReceiverAddressVO;
import com.example.petproject.entity.vo.ReturnVO;
import com.example.petproject.service.ReceiverAddressService;
import jakarta.annotation.Resource;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

/**
 * 包名称：com.example.petproject.controller
 * 类名称：UmsReceiverAddressController
 * 类描述：
 * 创建人：@author DrinkMore-HotWater
 * 创建时间：2024年01月24日 11:16
 **/
@RestController
@RequestMapping("/ums/receiverAddress")
public class UmsReceiverAddressController {

    @Resource
    private ReceiverAddressService receiverAddressService;

    @GetMapping("/list")
    public ReturnVO<?> getReceiverAddress(Long userId) {
        List<ReceiverAddressVO> receiverAddressVOS = receiverAddressService.getReceiverAddressByUserId(userId);
        return ReturnVO.ok(receiverAddressVOS);
    }
}
